package com.mx.project.pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

@Data
public class User implements Serializable {
    private Integer uid;

    @ApiModelProperty(required = true)
    @NotBlank
    private String username;

    @ApiModelProperty(required = true)
    @NotBlank
    private String password;

    @ApiModelProperty(required = true)
    @NotBlank
    private String nickname;

    @ApiModelProperty(required = true)
    @NotBlank
    @Pattern(regexp = "^1(3|4|5|7|8|9)\\d{9}$")
    private String phone;

    @ApiModelProperty(required = true)
    @NotNull
    @Min(0)
    @Max(1)
    private Integer sex;

    @ApiModelProperty(required = true)
    @NotBlank
    @Email
    private String email;

    private String address;

    private Date birth;

    private String avatar;

    private Integer state;

    private Date createTime;

    @ApiModelProperty(required = true)
    /**验证码 verification code 注册时,不能为null**/
    @NotBlank(message = "验证码不能为空!")
    private String vc;

}